(function(){ Vue.component('page-header', { template: '
\
\
\
\
\
\ \ [满意度调查]您于2018年2月14日10点30分预约了上饶市第一医院眼科的门诊\
\
\
\ 您好,请登录\ \ \ 个人中心\ \ 下载APP\ 安全退出\
\
\
\
\
\
\
\ \
\
\ {{item.text}}\
\
\ \
\
\
\
', props: [], data: function(){ return { isLogin: false, searchText: '', navList: [{ id: 0, text: "首页", link: '../../home/html/index.html', pathname: "home/html/index.html" },{ id: 1, text: "预约挂号", link: '../../appointment/html/home.html', pathname: "appointment/html/home.html" },{ id: 2, text: "健康档案", link: '../../', pathname: "health/html/" },{ id: 3, text: "我的就诊", link: '../../mineJiuZhen/html/mineJiuZhen.html', pathname: "mineJiuZhen/html/mineJiuZhen.html" }], selectedNav: 0, loginInfo: {}, loginUrl: "../../login/html/login.html", userCenterUrl: "" } }, mounted: function(){ //判断页面中是否存在登录信息 var oauthInfo = window.sessionStorage.getItem("oauthInfo"); if(oauthInfo){ this.isLogin = true; oauthInfo = JSON.parse(oauthInfo); this.loginInfo = oauthInfo; } //判断当前页面是第几个菜单页 var selectedNav = window.sessionStorage.getItem("selectedNav"), pathname = window.location.pathname; var obj = _.find(this.navList, function(o){ if(pathname.indexOf(o.pathname) > -1){ return o; } }); if(selectedNav && obj){ this.selectedNav = obj.id; window.sessionStorage.setItem("selectedNav", obj.id); }else if(selectedNav && !obj){ this.selectedNav = selectedNav; } }, methods: { login: function(){ //跳转到登录页面 }, goToCenter: function(){ //跳转去个人中心页面 window.location.href = "../../mine/html/personal-info.html"; }, logout: function(){ }, download: function(){ //下载APP }, chooseNav: function(val){ window.sessionStorage.setItem("selectedNav", val); this.selectedNav = val; var url = this.navList[val].link; window.location.href = url; } } }) })()